package com.guoxue.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.guoxue.dao.IStoryDao;
import com.guoxue.domain.StoryConfigVo;
@Repository
public class StoryDaoImpl extends BaseDaoImpl<StoryConfigVo> implements IStoryDao {

	@Override
	public List<StoryConfigVo> getStoryConfigList() {
		return find("From StoryConfigVo");
	}

	@Override
	public void saveStoryConfig(StoryConfigVo sc) {
		saveOrUpdate(sc);
	}

	@Override
	public void deleteStory(int id) {
		executeHql("DELETE FROM StoryConfigVo s WHERE s.storyId=?", new Object[] {id});
	}

	@Override
	public StoryConfigVo getStory(int storyId) {
		return get("FROM StoryConfigVo s WHERE s.storyId=?", new Object[] {storyId});
	}

}
